const defaultFont = "system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol"
const echartsDefaultColor = ["#c23531","#2f4554", "#61a0a8", "#d48265", "#91c7ae","#749f83", "#ca8622", "#bda29a","#6e7074","#546570", "#c4ccd3"]
const defaultTitle = {
  name: "未命名",
  style: {
    fontFamily: defaultFont,
    fontSize: "16px"
  }
}
const defaultOption = {
  title: defaultTitle,
  option: {
    xAxis:{
      gridIndex: 0,
      show: false,
      position: "bottom",
      type: "category",
      name: "",
      nameTextStyle: {
        fontFamily: defaultFont,
        fontSize: 12,
        color: "#000000"
      },
      nameLocation: "",
      data: [],
      axisLine: {
        show: true
      },
      axisTick: {
        show: true,
        length: 14
      }
    },
    yAxis: {
      show: false,
      position: "top",
      type: "value",
      name: "",
      nameLocation: "",
      nameTextStyle: {
        fontFamily: defaultFont,
        fontSize: 12,
        color: "#000000"
      },
      axisLine: {
        show: true
      },
      axisTick: {
        show: true
      }
    },
    legend: {
      show: false,
      left: "center",
      right: "auto",
      top: "top",
      bottom: "auto",
      width: "auto",
      height: "auto",
      orient: "horizontal",
      textStyle: {
        fontFamily: defaultFont,
        fontSize: 12
      }
    },
    series: [],
    backgroundColor: "transparent"
  }
}
export const fontFamilyList = [
  { name: "默认", value: defaultFont },
  { name: "微软雅黑", value: "Microsoft Yahei" },
  { name: "苹方", value: "PingFang SC" },
  { name: "黑体", value: "SimHei" },
  { name: "楷体", value: "KaiTi" },
  { name: "宋体", value: "SimSun" }
]
// 画布id
export const canvasId = "c-editor-canvas"
// 业务组件type
export const analysisComponentTypes = {
  myAnalysis: "myAnalysis",
  commonAnalysis: "commonAnalysis"
}
// 触发业务组件更新的更新方式
export const analysisComponentUpdateTypes = {
  filterComponent: "filterComponent", // 过滤组件导致的更新
  linkage: "linkage", // 触发联动设置导致的更新
}

// 过滤组件type
export const fliterComponentTypes = {
  select: "select",
  date: "date", // 日期
  dateArray: "dateArray", // 日期范围
  button: "button"

}

// 按钮类型
export const buttonTypeOptions = [
  {
    label: "默认",
    value: "default"
  },
  {
    label: "主要",
    value: "primary"
  },
  {
    label: "危险",
    value: "danger"
  },
  {
    label: "虚线",
    value: "dashed"
  },
]



export const mouseStatus =  {
  DEFAULT: "default", // 默认状态
  ADD_DRAG: "addDrag", // 拖拽左侧组件,准备往画布中新增组件
  ZOOM: "move", // 拖动组件point-zoom
  DRAG: "drag", // 拖动组件drag-wrap
}
// 背景重复
export const backgroundRepeatOptions = [
  {
    label: "重复",
    value: "repeat"
  },
  {
    label: "水平方向重复",
    value: "repeat-x"
  },
  {
    label: "竖直方向重复",
    value: "repeat-y"
  },
  {
    label: "不重复",
    value: "no-repeat"
  },
  {
    label: "继承父元素",
    value: "inherit"
  },

]

// 默认背景属性
export const defaultBackgroundAttr = {
  backgroundColor: "#ffffff",
  backgroundImage: "",
  backgroundSize: "100% 100%",
  backgroundPosition: "center center",
  backgroundRepeat: "repeat"
}

// 默认全局标题样式属性
export const defaultTitleAttr = {
  fontSize: undefined,
  isBold: false,
  isTilt: false, // 是否倾斜 font-style: italic
  fontFamily: undefined,
  lineHeight: undefined,
  textAlign: undefined,
  color: undefined
}
// 字体
export const fontFamilyOptions = fontFamilyList.map(item => ({
    ...item,
    label: item.name
  }))




// 默认store数据
export const defaultStoreData = {
  pageSetting: {
    width: 1300,
    height: 700,
    title: "大数据可视化看板",
    isGrid: true,
    ...defaultBackgroundAttr,
    globalTitleStyle: {
      ...defaultTitleAttr
    }
  }
}

export const unitOptions = [
  {
    value: "px",
    label: "px"
  },
  {
    value: "%",
    label: "%"
  }
]

export const textAlignOptions = [
  {
    value: "left",
    label: "居左"
  },
  {
    value: "center",
    label: "居中"
  },
  {
    value: "right",
    label: "居右"
  }
]

// 过滤字段的字段类型在过滤等于条件时对应的type
export const filterTableFieldTypes = {
  STRING: 3,
  INT: 11,
  DATETIME: 22,
  DATETIMES: 17
}

// export const sizeOptions = [
//   {
//     label: "默认",
//     value: "default"
//   },
//   {
//     label: "小",
//     value: "small"
//   },
//   {
//     label: "大",
//     value: "large"
//   },
// ]

export const borderStyleOptions = [
  {
    value: "solid",
    label: "实线"
  },
  {
    value: "dashed",
    label: "虚线"
  },
]


export const dateFormatOptions = [
  {
    value: "YYYY-MM-DD HH:mm:ss",
    label: "年年年年-月月-日日 时时:分分:秒秒",
  },
  {
    value: "YYYY/MM/DD HH:mm:ss",
    label: "年年年年/月月/日日 时时:分分:秒秒",
  },
  {
    value: "YYYY-MM-DD",
    label: "年年年年-月月-日日",
  },
  {
    value: "YYYY/MM/DD",
    label: "年年年年/月月/日日",
  },
  {
    value: "YYYY",
    label: "年年年年",
  },
  {
    value: "YYYY-MM",
    label: "年年年年-月月",
  }
]

export const defaultFarmat = {
  valueFormat:"YYYY-MM-DD HH:mm:ss",
  format:"YYYY-MM-DD HH:mm:ss",
}

export const selectModeOptions = [
  {
    label: "单选",
    value: "default"
  },
  {
    label: "多选",
    value: "multiple"
  }
]
